/**
 * definitions.h is part of Gedule.
 *
 * Gedule is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Gedule is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Gedule.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef DEFINITIONS_H
#define DEFINITIONS_H

#include <set>
#include <limits>
#include <string>

// Forward declaration
class Constraint;
class ModelConstraint;
class TaskConstraint;
class ResourceConstraint;
class Task;
class Resource;

// typedefs.
typedef std::set< Constraint * >            tConstraints;           // Set of constraints.
typedef std::set< ModelConstraint * >       tModelConstraints;      // Set of model constraints.
typedef std::set< TaskConstraint * >        tTaskConstraints;       // Set of task constraints.
typedef std::set< ResourceConstraint * >    tResourceConstraints;   // Set of resource constraints.
typedef std::set< Task * >                  tTasks;                 // Set of tasks.
typedef std::set< Resource * >              tResources;             // Set of resources.

typedef unsigned short tTime;               // for time variables.
typedef unsigned short tCapacity;           // Resource's capacity.
typedef unsigned short tNeededResources;    // Resources needed by a tasks.

typedef unsigned int tId;    // Id type.

typedef void ( * tCallback ) ( void *, void * );    // callbacks.

// constants.
const tTime MAX_TIME = std::numeric_limits< tTime >::max();
const tTime MIN_TIME = std::numeric_limits< tTime >::min();
const tId   INVALID_ID = std::numeric_limits< tId >::max();

// xml tags
const std::string MODEL_TAG                              = "Model";
const std::string TASK_TAG                               = "Task";
const std::string RESOURCE_TAG                           = "Resource";
const std::string CONSTRAINT_TAG                         = "Constraint";
const std::string UNAVAILABILITY_TAG                     = "Unavalability";

// xml constraint types
const std::string TIME_WINDOW_CONSTRAINT_TYPE            = "timewindow";
const std::string LENGHT_CONSTRAINT_TYPE                 = "lenght";
const std::string CAPACITY_CONSTRAINT_TYPE               = "capacity";
const std::string RESOURCES_NEEDED_CONSTRAINT_TYPE       = "resourcesneeded";
const std::string ALLOW_IDLE_CONSTRAINT_TYPE             = "allowidle";
const std::string MAX_TIME_CONSTRAINT_TYPE               = "maxtime";
const std::string PRECEDENCE_CONSTRAINT_TYPE             = "precedence";
const std::string UNAVAILABILITIES_CONSTRAINT_TYPE       = "unavailabilities";

// xml attributes
const std::string ID_ATTRIBUTE                           = "id";
const std::string TYPE_ATTRIBUTE                         = "type";
const std::string START_ATTRIBUTE                        = "start";
const std::string END_ATTRIBUTE                          = "end";
const std::string LENGHT_ATTRIBUTE                       = "lenght";
const std::string CAPACITY_ATTRIBUTE                     = "capacity";
const std::string RESOURCES_NEEDED_ATTRIBUTE             = "resourcesneeded" ;
const std::string ALLOW_IDLE_ATTRIBUTE                   = "allowidle";
const std::string MAX_TIME_ATTRIBUTE                     = "maxtime";
const std::string BEFORE_ATTRIBUTE                       = "before";
const std::string AFTER_ATTRIBUTE                        = "after";

// string constants.
const std::string TRUE       = "true";
const std::string FALSE      = "false";
const std::string UNNAMED    = "UNNAMED";


#endif // DEFINITIONS_H
